// 拦截器,可以在页面上配置拦截器来传递相应的资源
axios.interceptors.request.use(function (config) {
    // Do something before request is sent
    config.headers.token = localStorage.getItem("token");
    return config;
}, function (error) {
    // Do something with request error
    return Promise.reject(error);
});

// Add a response interceptor
axios.interceptors.response.use(function (response) {
    // Do something with response data
    return response;
}, function (error) {
    // Do something with response error
    return Promise.reject(error);
});